//
//  BCEmailCaptchaRequest.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/11/29.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import "BCEmailCaptchaRequest.h"

@implementation BCEmailCaptchaRequest

- (HttpRequestMethod)requestMethod {
    return POST;
}
- (NSString *)service {
    return @"App.Register.Send_email_captcah";
}

- (NSString *)encrypted {
    return [[NSString stringWithFormat:@"%@-%@",self.app_id,self.email] md532].lowercaseString;
}

- (BOOL)success:(NSURLSessionDataTask *)task data:(id)obj {
    BOOL success = [super success:task data:obj];
    if (success) {
        BCEmailCaptchaResponse *resp = [BCEmailCaptchaResponse yy_modelWithJSON:obj];
        if (self.requestSuccessed) {
            self.requestSuccessed(resp, nil);
        }
    }
    return success;
}

@end
